package org.csc.admin.controller;

import org.csc.admin.entity.User;
import org.csc.admin.service.ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
@RequestMapping("public")
public class TestController extends BaseController {

    @Autowired
    private ApiService apiService;
    @Value("${from}")
    private String from;


    @GetMapping("api")
    public String api() {
        return apiService.apiTest();
    }


    @GetMapping("test")
    public String test() {

        return this.from;
    }

    @GetMapping("getUser")
    public User getUser() {
        return super.getUser();
    }

    @GetMapping("admin")
    public String admin() {

        return "admin";
    }
}
